/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * eCOM - Adopte un Presta - Mars-Avril 2013
 * @author William
 */
@Entity
@Table(name = "CV")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cv.findAll", query = "SELECT c FROM Cv c"),
    @NamedQuery(name = "Cv.findByIdCV", query = "SELECT c FROM Cv c WHERE c.idCV = :idCV"),
    @NamedQuery(name = "Cv.findByDateDeNaissance", query = "SELECT c FROM Cv c WHERE c.dateDeNaissance = :dateDeNaissance"),
    @NamedQuery(name = "Cv.findBySituationMatrimoniale", query = "SELECT c FROM Cv c WHERE c.situationMatrimoniale = :situationMatrimoniale"),
    @NamedQuery(name = "Cv.findByFormation", query = "SELECT c FROM Cv c WHERE c.formation = :formation"),
    @NamedQuery(name = "Cv.findByCompetences", query = "SELECT c FROM Cv c WHERE c.competences = :competences"),
    @NamedQuery(name = "Cv.findByExperienceProfessionnelle", query = "SELECT c FROM Cv c WHERE c.experienceProfessionnelle = :experienceProfessionnelle"),
    @NamedQuery(name = "Cv.findByLoisirs", query = "SELECT c FROM Cv c WHERE c.loisirs = :loisirs")})
public class Cv implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idCV")
    private Integer idCV;
    @Column(name = "dateDeNaissance")
    @Temporal(TemporalType.DATE)
    private Date dateDeNaissance;
    @Size(max = 20)
    @Column(name = "situationMatrimoniale")
    private String situationMatrimoniale;
    @Size(max = 250)
    @Column(name = "formation")
    private String formation;
    @Size(max = 250)
    @Column(name = "competences")
    private String competences;
    @Size(max = 250)
    @Column(name = "experienceProfessionnelle")
    private String experienceProfessionnelle;
    @Size(max = 250)
    @Column(name = "loisirs")
    private String loisirs;

    public Cv() {
    }

    public Cv(Integer idCV) {
        this.idCV = idCV;
    }

    public Integer getIdCV() {
        return idCV;
    }
    
    // Constructeur complet appelé par DaoJpa
    public Cv(Integer idCV, Date dateDeNaissance, String situationMatrimoniale,
            String formation, String competences, String experienceProfessionnelle,
            String loisirs) {
        this.idCV = idCV;
        this.dateDeNaissance = dateDeNaissance;
        this.situationMatrimoniale = situationMatrimoniale;
        this.formation = formation;
        this.competences = competences;
        this.experienceProfessionnelle = experienceProfessionnelle;
        this.loisirs = loisirs;
    }

    public void setIdCV(Integer idCV) {
        this.idCV = idCV;
    }

    public Date getDateDeNaissance() {
        return dateDeNaissance;
    }

    public void setDateDeNaissance(Date dateDeNaissance) {
        this.dateDeNaissance = dateDeNaissance;
    }

    public String getSituationMatrimoniale() {
        return situationMatrimoniale;
    }

    public void setSituationMatrimoniale(String situationMatrimoniale) {
        this.situationMatrimoniale = situationMatrimoniale;
    }

    public String getFormation() {
        return formation;
    }

    public void setFormation(String formation) {
        this.formation = formation;
    }

    public String getCompetences() {
        return competences;
    }

    public void setCompetences(String competences) {
        this.competences = competences;
    }

    public String getExperienceProfessionnelle() {
        return experienceProfessionnelle;
    }

    public void setExperienceProfessionnelle(String experienceProfessionnelle) {
        this.experienceProfessionnelle = experienceProfessionnelle;
    }

    public String getLoisirs() {
        return loisirs;
    }

    public void setLoisirs(String loisirs) {
        this.loisirs = loisirs;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCV != null ? idCV.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cv)) {
            return false;
        }
        Cv other = (Cv) object;
        if ((this.idCV == null && other.idCV != null) 
                || (this.idCV != null && !this.idCV.equals(other.idCV))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Cv[ idCV=" + idCV + " ]";
    }
    
}
